import glob

import XTestRunner
import yagmail,logging
from XTestRunner import HTMLTestRunner
class MyTools():
    def log_set(self):
        log = logging.basicConfig(filemode='a+',filename=r'D:\1\PythonProject2\Log\lll.log',format='%(message)s',level=logging.DEBUG)
        return log

    def report(self):
        report = XTestRunner.HTMLTestRunner(open('./Report/my.html','wb'),title='测试报告')
        return report
    def sendemail(self):
        file = glob.glob('./Report/my.html')
        email = yagmail.SMTP(user='3315608326@qq.com',password='hjvhfyfvztaxchei',host='smtp.qq.com')
        email.send(to='3315608326@qq.com',subject='测试报告',attachments=file)
        email.close()